package com.lyf.boot.modules.index.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.lyf.boot.config.MqttServer;
import com.lyf.boot.core.model.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * mqtt
 * @author Luyufan
 * @date 2024/7/10 15:35
 **/
@RestController
@RequestMapping("mqtt")
public class MqttController {


    @SaIgnore
    @GetMapping("/send")
    public R<Void> send(String msg){
        MqttServer.publish(0,false,"topic1",msg);
        return R.ok();
    }
}
